home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / M / Mac gperf 1.9.cpt / Mac gperf 1.9 / src / xmalloc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-09  |  1.0 KB  |  37 lines  |  [TEXT/KAHL]

  1. /* Provide a useful malloc sanity checker....
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
  4.  
  5. This file is part of GNU GPERF.
  6.  
  7. GNU GPERF is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 1, or (at your option)
  10. any later version.
  11.  
  12. GNU GPERF is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with GNU GPERF; see the file COPYING.  If not, write to
  19. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23.  
  24. #include "xmalloc.h"
  25.  
  26. char * xmalloc( size_t size )
  27. {
  28.     char *    temp = malloc( size );
  29.  
  30.     if ( temp == 0 )
  31.     {
  32.         fprintf( stderr, "out of virtual memory\n" );
  33.         exit( 1 );
  34.     }
  35.     return temp;
  36. }
  37.